AC_INIT(mp_poly, 1.0, alan.dion@gmail.com)

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(FourierTron.cpp)

AM_INIT_AUTOMAKE

AC_PROG_CXX
AC_PROG_LIBTOOL

CXXFLAGS="-Werror -Wall ${CXXFLAGS}"
LDFLAGS="${LD_LIBRARY_PATH} ${LDFLAGS}"

PKG_CHECK_MODULES([Seamstress], [seamstress])

AC_SUBST(mpfr_INCDIR)

AC_ARG_WITH(
  mpfr-inc-path,
  AS_HELP_STRING(
    [--with-mpfr-inc-path=DIR],
    [location of the mpfr headers]
  ),
  [mpfr_INCDIR="-I$withval"],
  [mpfr_INCDIR='']
)

AC_SUBST(mpfr_LIBDIR)

AC_ARG_WITH(
  mpfr-lib-path,
  AS_HELP_STRING(
    [--with-mpfr-lib-path=DIR],
    [location of the mpfr libraries]
  ),
  [mpfr_LIBDIR="-L$withval"],
  [mpfr_LIBDIR='']
)


AC_SUBST(gmp_INCDIR)

AC_ARG_WITH(
  gmp-inc-path,
  AS_HELP_STRING(
    [--with-gmp-inc-path=DIR],
    [location of the gmp headers]
  ),
  [gmp_INCDIR="-I$withval"],
  [gmp_INCDIR='']
)

AC_SUBST(gmp_LIBDIR)

AC_ARG_WITH(
  gmp-lib-path,
  AS_HELP_STRING(
    [--with-gmp-lib-path=DIR],
    [location of the gmp libraries]
  ),
  [gmp_LIBDIR="-L$withval"],
  [gmp_LIBDIR='']
)




AC_CONFIG_FILES([Makefile mp_poly.pc])

AC_OUTPUT
